<div class th:fragment="html">
    <script>
        $(function(){
            var keyword = getUrlParms("keyword");
            var data4Vue = {
                uri:'foresearch',
                houses:[]
            };
            //ViewModel
            var vue = new Vue({
                el: '#workingArea',
                data: data4Vue,
                mounted:function(){ //mounted　表示这个 Vue 对象加载成功了
                    this.load();
                },
                methods: {
                    load:function(){
                        var url =  this.uri+"?keyword="+keyword;
                        axios.post(url).then(function(response) {
                            vue.houses = response.data;
                            vue.$nextTick(function(){
                                linkDefaultActions();
                            })
                        });
                    },
                    checklogin:function () {
                        var url = "forecheckLogin";
                        axios.get(url).then(function(response) {
                            if(0==response.data.code) {
                            }
                            else{
                                alert("请先登录,登录成功即可查看哦！");
                                location.href="login";

//                                $("#loginModal").modal('show');
                            }
                        });
                        return false;
                    }
                }
            });
        })
    </script>
<div id="workingArea">
    <div id="searchResult">
        <div class="searchResultDiv">
            <div class="searchProducts">
                <div class="productUnit"  v-for="h in houses" >
                    <div @click="checklogin()">
                    <a :href="'house?hid='+h.id">
                        <img class="productImage" :src="'img/houseSingle/'+h.firstHouseImage.id+'.jpg'">
                    </a>
                    <!--{{h.location}}-->

                    <span class="productPrice">
                价格：{{h.price}}
            </span>


                    <a class="productLink" :href="'product?hid='+h.id">
                        位置：{{h.location}}
                    </a>

                    <a  class="tmallLink" :href="'house?hid='+h.id">快来瞧瞧</a>

                    <a :href="'house?hid='+h.id">
                    <div class="show1 productInfo">
                        <!--<span class="monthDeal ">月成交 <span class="productDealNumber">{{p.saleCount}}笔</span></span>-->
                        <span class="productReview">评价<span class="productReviewNumber">{{h.reviewCount}}</span></span>
                        <!--<span class="wangwang"><img src="img/site/wangwang.png"></span>-->
                    </div>
                        </a>

                </div>




            </div>
                <br>
                <br>
                <br>
                <br>
                <div v-if="0 == houses.length" class="noMatch">
                    没有满足条件的产品
                    <br>
                    <br>
                    <br>
                    <br>
                </div>
                <div style="clear:both"></div>
        </div>
            <div class="wrapper">
                <br>
                <br>
                <br>
                <br>
                <span class="line"></span>
                <span class="content">我是有底线的</span>
                <span class="line"></span>
                <br>
                <br>
                <br>
                <br>
            </div>
    </div>

</div>

</div>

</div>
